• CFA2 tests

    CFA2 tests

    Accounts

    Seed Address Public_key Public_key_hash Secret_key
    'Alice'tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1GwiedpkuvNy6TuQ2z8o9wnoaTtTXkzQk7nhegCHfxBc4ecsd4qG71KYNGtz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1GwiedskRijgcXx8gzqkq7SCBbrb6aDZQMmP6dznCQWgU1Jr4qPfJT1yFq5A39ja9G4wahS8uWtBurZy14Hy7GZkQh7WnopJTKtCQG
    'admin'tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5edpkthtmpNV7DzPgvsU5ktVkfYbARpb2nzDbncU8mdbMeXGRhGTjN7tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5edskRjPeZkNsmeJ8aAzs5vyXVhP7DVRvG6nM1ReNfjzkR3h6ykbf71mPxQyE5HU9FHrV3EdrY4GVCSBWhU44v6bnhQGrKM9Cs8

    Contracts

    Contract

    New contract: KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    Balance: 0.000000tz

    Storage:

    Borrow_allowed Mint_allowed Redeem_allowed Repay_borrow_allowed
    TrueTrueTrueTrue

    Code:

    import smartpy as sp

    class Contract(sp.Contract):
    def __init__(self):
      self.init_type(sp.TRecord(borrow_allowed = sp.TBool, mint_allowed = sp.TBool, redeem_allowed = sp.TBool, repay_borrow_allowed = sp.TBool).layout((("borrow_allowed", "mint_allowed"), ("redeem_allowed", "repay_borrow_allowed"))))
      self.init(borrow_allowed = True,
                mint_allowed = True,
                redeem_allowed = True,
                repay_borrow_allowed = True)


    @sp.entry_point
    def acceptGovernance(self, params):
      sp.set_type(params, sp.TAddress)

    @sp.entry_point
    def borrowAllowed(self, params):
      sp.set_type(params, sp.TRecord(borrowAmount = sp.TNat, borrower = sp.TAddress, cToken = sp.TAddress).layout(("cToken", ("borrower", "borrowAmount"))))
      sp.verify(self.data.borrow_allowed)

    @sp.entry_point
    def disableMarket(self, params):
      sp.set_type(params, sp.TUnit)

    @sp.entry_point
    def enterMarkets(self, params):
      sp.set_type(params, sp.TUnit)

    @sp.entry_point
    def exitMarket(self, params):
      sp.set_type(params, sp.TUnit)

    @sp.entry_point
    def getHypoAccountLiquidity(self, params):
      sp.set_type(params, sp.TUnit)

    @sp.entry_point
    def mintAllowed(self, params):
      sp.set_type(params, sp.TRecord(cToken = sp.TAddress, mintAmount = sp.TNat, minter = sp.TAddress).layout(("cToken", ("minter", "mintAmount"))))
      sp.verify(self.data.mint_allowed)

    @sp.entry_point
    def redeemAllowed(self, params):
      sp.set_type(params, sp.TRecord(cToken = sp.TAddress, redeemAmount = sp.TNat, redeemer = sp.TAddress).layout(("cToken", ("redeemer", "redeemAmount"))))
      sp.verify(self.data.redeem_allowed)

    @sp.entry_point
    def repayBorrowAllowed(self, params):
      sp.set_type(params, sp.TRecord(borrower = sp.TAddress, cToken = sp.TAddress, payer = sp.TAddress, repayAmount = sp.TNat).layout(("cToken", ("payer", ("borrower", "repayAmount")))))
      sp.verify(self.data.repay_borrow_allowed)

    @sp.entry_point
    def setBorrowAllowed(self, params):
      self.data.borrow_allowed = params

    @sp.entry_point
    def setBorrowPaused(self, params):
      sp.set_type(params, sp.TUnit)

    @sp.entry_point
    def setCloseFactor(self, params):
      sp.set_type(params, sp.TUnit)

    @sp.entry_point
    def setCollateralFactor(self, params):
      sp.set_type(params, sp.TUnit)

    @sp.entry_point
    def setLiquidationIncentive(self, params):
      sp.set_type(params, sp.TUnit)

    @sp.entry_point
    def setLiquidityPeriodRelevance(self, params):
      sp.set_type(params, sp.TNat)

    @sp.entry_point
    def setMarketBorrowCap(self, params):
      sp.set_type(params, sp.TUnit)

    @sp.entry_point
    def setMintAllowed(self, params):
      self.data.mint_allowed = params

    @sp.entry_point
    def setMintPaused(self, params):
      sp.set_type(params, sp.TUnit)

    @sp.entry_point
    def setPendingGovernance(self, params):
      sp.set_type(params, sp.TAddress)

    @sp.entry_point
    def setPriceOracle(self, params):
      sp.set_type(params, sp.TUnit)

    @sp.entry_point
    def setPricePeriodRelevance(self, params):
      sp.set_type(params, sp.TNat)

    @sp.entry_point
    def setRedeemAllowed(self, params):
      self.data.redeem_allowed = params

    @sp.entry_point
    def setRepayBorrowAllowed(self, params):
      self.data.repay_borrow_allowed = params

    @sp.entry_point
    def setTransferPaused(self, params):
      sp.set_type(params, sp.TUnit)

    @sp.entry_point
    def supportMarket(self, params):
      sp.set_type(params, sp.TUnit)

    @sp.entry_point
    def transferAllowed(self, params):
      sp.set_type(params, sp.TRecord(cToken = sp.TAddress, dst = sp.TAddress, src = sp.TAddress, transferTokens = sp.TNat).layout((("cToken", "src"), ("dst", "transferTokens"))))

    @sp.entry_point
    def updateAccountLiquidity(self, params):
      sp.set_type(params, sp.TAddress)

    @sp.entry_point
    def updateAssetPrice(self, params):
      sp.set_type(params, sp.TAddress)
    Contract

    New contract: KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    Balance: 0.000000tz

    Storage:

    BorrowRate SupplyRate

    Code:

    import smartpy as sp

    class Contract(sp.Contract):
    def __init__(self):
      self.init_type(sp.TRecord(borrowRate = sp.TNat, supplyRate = sp.TNat).layout(("borrowRate", "supplyRate")))
      self.init(borrowRate = 840000000000,
                supplyRate = 180000000000)


    @sp.entry_point
    def getBorrowRate(self, params):
      sp.set_type(params, sp.TRecord(borrows = sp.TNat, cash = sp.TNat, cb = sp.TContract(sp.TNat), reserves = sp.TNat).layout((("borrows", "cash"), ("cb", "reserves"))))
      sp.transfer(self.data.borrowRate, sp.tez(0), params.cb)

    @sp.entry_point
    def getSupplyRate(self, params):
      sp.set_type(params, sp.TRecord(borrows = sp.TNat, cash = sp.TNat, cb = sp.TContract(sp.TNat), reserves = sp.TNat).layout((("borrows", "cash"), ("cb", "reserves"))))
      sp.transfer(self.data.supplyRate, sp.tez(0), params.cb)

    @sp.entry_point
    def setBorrowRate(self, params):
      sp.set_type(params, sp.TNat)
      self.data.borrowRate = params

    @sp.entry_point
    def setSupplyRate(self, params):
      sp.set_type(params, sp.TNat)
      self.data.supplyRate = params
    Contract

    New contract: KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H

    Balance: 0.000000tz

    Storage:

    Administrator All_tokens Ledger Metadata Operators Paused Token_metadata Total_supply
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    Key Balance
    Key Value
    ''0x68747470733a2f2f6578616d706c652e636f6d
    Key Value
    False
    Key Token_id Token_info
    Key Value

    Code:

    import smartpy as sp

    class Contract(sp.Contract):
    def __init__(self):
      self.init_type(sp.TRecord(administrator = sp.TAddress, all_tokens = sp.TNat, ledger = sp.TMap(sp.TPair(sp.TAddress, sp.TNat), sp.TRecord(balance = sp.TNat).layout("balance")), metadata = sp.TBigMap(sp.TString, sp.TBytes), operators = sp.TMap(sp.TRecord(operator = sp.TAddress, owner = sp.TAddress, token_id = sp.TNat).layout(("owner", ("operator", "token_id"))), sp.TUnit), paused = sp.TBool, token_metadata = sp.TMap(sp.TNat, sp.TRecord(token_id = sp.TNat, token_info = sp.TMap(sp.TString, sp.TBytes)).layout(("token_id", "token_info"))), total_supply = sp.TMap(sp.TNat, sp.TNat)).layout(((("administrator", "all_tokens"), ("ledger", "metadata")), (("operators", "paused"), ("token_metadata", "total_supply")))))
      self.init(administrator = sp.address('tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5'),
                all_tokens = 0,
                ledger = {},
                metadata = {'' : sp.bytes('0x68747470733a2f2f6578616d706c652e636f6d')},
                operators = {},
                paused = False,
                token_metadata = {},
                total_supply = {})


    @sp.entry_point
    def balance_of(self, params):
      sp.verify(~ self.data.paused, 'FA2_PAUSED')
      sp.set_type(params, sp.TRecord(callback = sp.TContract(sp.TList(sp.TRecord(balance = sp.TNat, request = sp.TRecord(owner = sp.TAddress, token_id = sp.TNat).layout(("owner", "token_id"))).layout(("request", "balance")))), requests = sp.TList(sp.TRecord(owner = sp.TAddress, token_id = sp.TNat).layout(("owner", "token_id")))).layout(("requests", "callback")))
      def f0(lparams_0):
        sp.verify(self.data.token_metadata.contains(lparams_0.token_id), 'FA2_TOKEN_UNDEFINED')
        sp.if self.data.ledger.contains((sp.set_type_expr(lparams_0.owner, sp.TAddress), sp.set_type_expr(lparams_0.token_id, sp.TNat))):
          sp.result(sp.record(request = sp.record(owner = sp.set_type_expr(lparams_0.owner, sp.TAddress), token_id = sp.set_type_expr(lparams_0.token_id, sp.TNat)), balance = self.data.ledger[(sp.set_type_expr(lparams_0.owner, sp.TAddress), sp.set_type_expr(lparams_0.token_id, sp.TNat))].balance))
        sp.else:
          sp.result(sp.record(request = sp.record(owner = sp.set_type_expr(lparams_0.owner, sp.TAddress), token_id = sp.set_type_expr(lparams_0.token_id, sp.TNat)), balance = 0))
      responses = sp.local("responses", params.requests.map(sp.build_lambda(f0)))
      sp.transfer(responses.value, sp.tez(0), sp.set_type_expr(params.callback, sp.TContract(sp.TList(sp.TRecord(balance = sp.TNat, request = sp.TRecord(owner = sp.TAddress, token_id = sp.TNat).layout(("owner", "token_id"))).layout(("request", "balance"))))))

    @sp.entry_point
    def mint(self, params):
      sp.verify(sp.sender == self.data.administrator, 'FA2_NOT_ADMIN')
      sp.verify(self.data.all_tokens == params.token_id, 'Token-IDs should be consecutive')
      self.data.all_tokens = sp.max(self.data.all_tokens, params.token_id + 1)
      sp.if self.data.ledger.contains((sp.set_type_expr(params.address, sp.TAddress), sp.set_type_expr(params.token_id, sp.TNat))):
        self.data.ledger[(sp.set_type_expr(params.address, sp.TAddress), sp.set_type_expr(params.token_id, sp.TNat))].balance += params.amount
      sp.else:
        self.data.ledger[(sp.set_type_expr(params.address, sp.TAddress), sp.set_type_expr(params.token_id, sp.TNat))] = sp.record(balance = params.amount)
      sp.if self.data.token_metadata.contains(params.token_id):
        pass
      sp.else:
        self.data.token_metadata[params.token_id] = sp.record(token_id = params.token_id, token_info = params.metadata)
        self.data.total_supply[params.token_id] = params.amount

    @sp.entry_point
    def set_administrator(self, params):
      sp.verify(sp.sender == self.data.administrator, 'FA2_NOT_ADMIN')
      self.data.administrator = params

    @sp.entry_point
    def set_metadata(self, params):
      sp.verify(sp.sender == self.data.administrator, 'FA2_NOT_ADMIN')
      self.data.metadata[params.k] = params.v

    @sp.entry_point
    def set_pause(self, params):
      sp.verify(sp.sender == self.data.administrator, 'FA2_NOT_ADMIN')
      self.data.paused = params

    @sp.entry_point
    def transfer(self, params):
      sp.verify(~ self.data.paused, 'FA2_PAUSED')
      sp.set_type(params, sp.TList(sp.TRecord(from_ = sp.TAddress, txs = sp.TList(sp.TRecord(amount = sp.TNat, to_ = sp.TAddress, token_id = sp.TNat).layout(("to_", ("token_id", "amount"))))).layout(("from_", "txs"))))
      sp.for transfer in params:
        sp.for tx in transfer.txs:
          sp.verify(((sp.sender == self.data.administrator) | (transfer.from_ == sp.sender)) | (self.data.operators.contains(sp.set_type_expr(sp.record(owner = transfer.from_, operator = sp.sender, token_id = tx.token_id), sp.TRecord(operator = sp.TAddress, owner = sp.TAddress, token_id = sp.TNat).layout(("owner", ("operator", "token_id")))))), 'FA2_NOT_OPERATOR')
          sp.verify(self.data.token_metadata.contains(tx.token_id), 'FA2_TOKEN_UNDEFINED')
          sp.if tx.amount > 0:
            sp.verify(self.data.ledger[(sp.set_type_expr(transfer.from_, sp.TAddress), sp.set_type_expr(tx.token_id, sp.TNat))].balance >= tx.amount, 'FA2_INSUFFICIENT_BALANCE')
            self.data.ledger[(sp.set_type_expr(transfer.from_, sp.TAddress), sp.set_type_expr(tx.token_id, sp.TNat))].balance = sp.as_nat(self.data.ledger[(sp.set_type_expr(transfer.from_, sp.TAddress), sp.set_type_expr(tx.token_id, sp.TNat))].balance - tx.amount)
            sp.if self.data.ledger.contains((sp.set_type_expr(tx.to_, sp.TAddress), sp.set_type_expr(tx.token_id, sp.TNat))):
              self.data.ledger[(sp.set_type_expr(tx.to_, sp.TAddress), sp.set_type_expr(tx.token_id, sp.TNat))].balance += tx.amount
            sp.else:
              self.data.ledger[(sp.set_type_expr(tx.to_, sp.TAddress), sp.set_type_expr(tx.token_id, sp.TNat))] = sp.record(balance = tx.amount)

    @sp.entry_point
    def update_operators(self, params):
      sp.set_type(params, sp.TList(sp.TVariant(add_operator = sp.TRecord(operator = sp.TAddress, owner = sp.TAddress, token_id = sp.TNat).layout(("owner", ("operator", "token_id"))), remove_operator = sp.TRecord(operator = sp.TAddress, owner = sp.TAddress, token_id = sp.TNat).layout(("owner", ("operator", "token_id")))).layout(("add_operator", "remove_operator"))))
      sp.for update in params:
        with update.match_cases() as arg:
          with arg.match('add_operator') as add_operator:
            sp.verify((add_operator.owner == sp.sender) | (sp.sender == self.data.administrator), 'FA2_NOT_ADMIN_OR_OPERATOR')
            self.data.operators[sp.set_type_expr(sp.record(owner = add_operator.owner, operator = add_operator.operator, token_id = add_operator.token_id), sp.TRecord(operator = sp.TAddress, owner = sp.TAddress, token_id = sp.TNat).layout(("owner", ("operator", "token_id"))))] = sp.unit
          with arg.match('remove_operator') as remove_operator:
            sp.verify((remove_operator.owner == sp.sender) | (sp.sender == self.data.administrator), 'FA2_NOT_ADMIN_OR_OPERATOR')
            del self.data.operators[sp.set_type_expr(sp.record(owner = remove_operator.owner, operator = remove_operator.operator, token_id = remove_operator.token_id), sp.TRecord(operator = sp.TAddress, owner = sp.TAddress, token_id = sp.TNat).layout(("owner", ("operator", "token_id"))))]
    Contract

    New contract: KT1Tezooo3zzSmartPyzzSTATiCzzzseJjWC

    Balance: 0.000000tz

    Storage:

    Last

    Code:

    import smartpy as sp

    class Contract(sp.Contract):
    def __init__(self):
      self.init_type(sp.TRecord(last = sp.TOption(sp.TNat)).layout("last"))
      self.init(last = sp.none)


    @sp.entry_point
    def target(self, params):
      self.data.last = sp.some(params)

    @sp.entry_point
    def targetNat(self, params):
      sp.set_type(params, sp.TNat)
      self.data.last = sp.some(params)
    Contract

    New contract: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TokenId TotalBorrows TotalReserves TotalSupply
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    Key AccountBorrows Approvals Balance
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HKT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFFalse

    Code:

    import smartpy as sp

    class Contract(sp.Contract):
    def __init__(self):
      self.init_type(sp.TRecord(accrualBlockNumber = sp.TNat, accrualIntPeriodRelevance = sp.TNat, activeOperations = sp.TSet(sp.TNat), administrator = sp.TAddress, balances = sp.TBigMap(sp.TAddress, sp.TRecord(accountBorrows = sp.TRecord(interestIndex = sp.TNat, principal = sp.TNat).layout(("interestIndex", "principal")), approvals = sp.TMap(sp.TAddress, sp.TNat), balance = sp.TNat).layout(("accountBorrows", ("approvals", "balance")))), borrowIndex = sp.TNat, borrowRateMaxMantissa = sp.TNat, borrowRatePerBlock = sp.TNat, comptroller = sp.TAddress, currentCash = sp.TNat, expScale = sp.TNat, fa2_TokenAddress = sp.TAddress, halfExpScale = sp.TNat, initialExchangeRateMantissa = sp.TNat, interestRateModel = sp.TAddress, isAccrualInterestValid = sp.TBool, pendingAdministrator = sp.TOption(sp.TAddress), reserveFactorMantissa = sp.TNat, reserveFactorMaxMantissa = sp.TNat, supplyRatePerBlock = sp.TNat, tokenId = sp.TNat, totalBorrows = sp.TNat, totalReserves = sp.TNat, totalSupply = sp.TNat).layout((((("accrualBlockNumber", ("accrualIntPeriodRelevance", "activeOperations")), ("administrator", ("balances", "borrowIndex"))), (("borrowRateMaxMantissa", ("borrowRatePerBlock", "comptroller")), ("currentCash", ("expScale", "fa2_TokenAddress")))), ((("halfExpScale", ("initialExchangeRateMantissa", "interestRateModel")), ("isAccrualInterestValid", ("pendingAdministrator", "reserveFactorMantissa"))), (("reserveFactorMaxMantissa", ("supplyRatePerBlock", "tokenId")), ("totalBorrows", ("totalReserves", "totalSupply")))))))
      self.init(accrualBlockNumber = 0,
                accrualIntPeriodRelevance = 5,
                activeOperations = sp.set([]),
                administrator = sp.address('tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5'),
                balances = {},
                borrowIndex = 1000000000000000000,
                borrowRateMaxMantissa = 5000000000000,
                borrowRatePerBlock = 0,
                comptroller = sp.address('KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1'),
                currentCash = 0,
                expScale = 1000000000000000000,
                fa2_TokenAddress = sp.address('KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H'),
                halfExpScale = 500000000000000000,
                initialExchangeRateMantissa = 1000000000000000000,
                interestRateModel = sp.address('KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF'),
                isAccrualInterestValid = False,
                pendingAdministrator = sp.none,
                reserveFactorMantissa = 0,
                reserveFactorMaxMantissa = 1000000000000000000,
                supplyRatePerBlock = 0,
                tokenId = 0,
                totalBorrows = 0,
                totalReserves = 0,
                totalSupply = 0)


    @sp.entry_point
    def acceptGovernance(self, params):
      sp.set_type(params, sp.TUnit)
      sp.verify(sp.sender == self.data.pendingAdministrator.open_some(message = 'CT_NOT_SET_PENDING_ADMIN'), 'CT_NOT_PENDING_ADMIN')
      self.data.administrator = self.data.pendingAdministrator.open_some()
      self.data.pendingAdministrator = sp.none

    @sp.entry_point
    def accrueInterest(self, params):
      sp.set_type(params, sp.TUnit)
      compute_CFA2_43 = sp.local("compute_CFA2_43", (self.data.currentCash + self.data.totalSupply) + self.data.totalReserves)
      sp.if compute_CFA2_43.value > 0:
        self.data.activeOperations.add(13)
        sp.transfer(sp.record(requests = sp.list([sp.record(owner = sp.self_address, token_id = self.data.tokenId)]), callback = sp.self_entry_point('setCash')), sp.tez(0), sp.contract(sp.TRecord(callback = sp.TContract(sp.TList(sp.TRecord(balance = sp.TNat, request = sp.TRecord(owner = sp.TAddress, token_id = sp.TNat).layout(("owner", "token_id"))).layout(("request", "balance")))), requests = sp.TList(sp.TRecord(owner = sp.TAddress, token_id = sp.TNat).layout(("owner", "token_id")))).layout(("requests", "callback")), self.data.fa2_TokenAddress, entry_point='balance_of').open_some())
      sp.if self.data.accrualBlockNumber == 0:
        self.data.accrualBlockNumber = sp.level
      sp.if sp.level != self.data.accrualBlockNumber:
        self.data.activeOperations.add(8)
        sp.transfer(sp.record(borrows = self.data.totalBorrows, cash = self.data.currentCash, cb = sp.self_entry_point('doAccrueInterest'), reserves = self.data.totalReserves), sp.tez(0), sp.contract(sp.TRecord(borrows = sp.TNat, cash = sp.TNat, cb = sp.TContract(sp.TNat), reserves = sp.TNat).layout((("borrows", "cash"), ("cb", "reserves"))), self.data.interestRateModel, entry_point='getBorrowRate').open_some())
      self.data.isAccrualInterestValid = True

    @sp.entry_point
    def addReserves(self, params):
      sp.set_type(params, sp.TNat)
      sp.verify(sp.sender != sp.self_address, 'CT_INTERNAL_CALL')
      sp.verify(sp.len(self.data.activeOperations) == 0, 'OP_IN_PROGRESS')
      self.data.activeOperations.add(11)
      sp.transfer(sp.unit, sp.tez(0), sp.self_entry_point('accrueInterest'))
      sp.transfer(sp.record(addAmount = params, originalSender = sp.sender), sp.amount, sp.self_entry_point('addReservesInternal'))

    @sp.entry_point
    def addReservesInternal(self, params):
      sp.verify(sp.sender == sp.self_address, 'CT_INTERNAL_FUNCTION')
      sp.verify(self.data.activeOperations.contains(11), 'OP_NOT_ACTIVE')
      self.data.activeOperations.remove(11)
      sp.set_type(sp.level, sp.TNat)
      sp.set_type(self.data.accrualBlockNumber, sp.TNat)
      compute_CToken_730 = sp.local("compute_CToken_730", sp.as_nat(sp.level - self.data.accrualBlockNumber, message = 'SUBTRACTION_UNDERFLOW'))
      sp.verify(compute_CToken_730.value < self.data.accrualIntPeriodRelevance, 'CT_INTEREST_OLD')
      sp.verify(self.data.isAccrualInterestValid, 'CT_INTEREST_INVALID')
      sp.transfer(sp.list([sp.record(from_ = params.originalSender, txs = sp.list([sp.record(to_ = sp.self_address, token_id = self.data.tokenId, amount = params.addAmount)]))]), sp.tez(0), sp.contract(sp.TList(sp.TRecord(from_ = sp.TAddress, txs = sp.TList(sp.TRecord(amount = sp.TNat, to_ = sp.TAddress, token_id = sp.TNat).layout(("to_", ("token_id", "amount"))))).layout(("from_", "txs"))), self.data.fa2_TokenAddress, entry_point='transfer').open_some())
      self.data.totalReserves += params.addAmount
      self.data.isAccrualInterestValid = False

    @sp.entry_point
    def approve(self, params):
      sp.set_type(params, sp.TRecord(spender = sp.TAddress, value = sp.TNat).layout(("spender", "value")))
      sp.verify(sp.sender != sp.self_address, 'CT_INTERNAL_CALL')
      sp.verify((self.data.balances[sp.sender].approvals.get(params.spender, default_value = 0) == 0) | (params.value == 0), 'CT_UNSAFE_ALLOWANCE_CHANGE')
      self.data.balances[sp.sender].approvals[params.spender] = params.value

    @sp.entry_point
    def borrow(self, params):
      sp.set_type(params, sp.TNat)
      sp.verify(sp.sender != sp.self_address, 'CT_INTERNAL_CALL')
      sp.if ~ (self.data.balances.contains(sp.sender)):
        self.data.balances[sp.sender] = sp.record(accountBorrows = sp.record(interestIndex = 0, principal = 0), approvals = {}, balance = 0)
      sp.transfer(sp.record(cToken = sp.self_address, borrower = sp.sender, borrowAmount = params), sp.tez(0), sp.contract(sp.TRecord(borrowAmount = sp.TNat, borrower = sp.TAddress, cToken = sp.TAddress).layout(("cToken", ("borrower", "borrowAmount"))), self.data.comptroller, entry_point='borrowAllowed').open_some())
      sp.verify(self.data.currentCash >= params, 'CT_INSUFFICIENT_CASH')
      sp.set_type(sp.level, sp.TNat)
      sp.set_type(self.data.accrualBlockNumber, sp.TNat)
      compute_CToken_730 = sp.local("compute_CToken_730", sp.as_nat(sp.level - self.data.accrualBlockNumber, message = 'SUBTRACTION_UNDERFLOW'))
      sp.verify(compute_CToken_730.value < self.data.accrualIntPeriodRelevance, 'CT_INTEREST_OLD')
      sp.verify(self.data.isAccrualInterestValid, 'CT_INTEREST_INVALID')
      sp.transfer(sp.list([sp.record(from_ = sp.self_address, txs = sp.list([sp.record(to_ = sp.sender, token_id = self.data.tokenId, amount = params)]))]), sp.tez(0), sp.contract(sp.TList(sp.TRecord(from_ = sp.TAddress, txs = sp.TList(sp.TRecord(amount = sp.TNat, to_ = sp.TAddress, token_id = sp.TNat).layout(("to_", ("token_id", "amount"))))).layout(("from_", "txs"))), self.data.fa2_TokenAddress, entry_point='transfer').open_some())
      borrowSnapshot = sp.local("borrowSnapshot", self.data.balances[sp.sender].accountBorrows)
      borrowBalance = sp.local("borrowBalance", 0)
      sp.if borrowSnapshot.value.principal > 0:
        borrowBalance.value = (borrowSnapshot.value.principal * self.data.borrowIndex) // borrowSnapshot.value.interestIndex
      self.data.balances[sp.sender].accountBorrows.principal = borrowBalance.value + params
      self.data.balances[sp.sender].accountBorrows.interestIndex = self.data.borrowIndex
      self.data.totalBorrows += borrowBalance.value + params
      self.data.isAccrualInterestValid = False

    @sp.entry_point
    def borrowBalanceStored(self, params):
      sp.set_type(sp.fst(params), sp.TAddress)
      borrowSnapshot = sp.local("borrowSnapshot", self.data.balances[sp.fst(params)].accountBorrows)
      borrowBalance = sp.local("borrowBalance", 0)
      sp.if borrowSnapshot.value.principal > 0:
        borrowBalance.value = (borrowSnapshot.value.principal * self.data.borrowIndex) // borrowSnapshot.value.interestIndex
      __s1 = sp.local("__s1", borrowBalance.value)
      sp.set_type(sp.snd(params), sp.TContract(sp.TNat))
      sp.transfer(__s1.value, sp.tez(0), sp.snd(params))

    @sp.entry_point
    def doAccrueInterest(self, params):
      sp.set_type(params, sp.TNat)
      sp.verify(sp.sender == self.data.interestRateModel, 'CT_SENDER_NOT_IRM')
      sp.verify(self.data.activeOperations.contains(8), 'OP_NOT_ACTIVE')
      self.data.activeOperations.remove(8)
      sp.verify(params <= self.data.borrowRateMaxMantissa, 'CT_INVALID_BORROW_RATE')
      sp.set_type(params, sp.TNat)
      sp.set_type(sp.record(mantissa = params), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(sp.as_nat(sp.level - self.data.accrualBlockNumber), sp.TNat)
      sp.set_type(params * sp.as_nat(sp.level - self.data.accrualBlockNumber), sp.TNat)
      compute_CToken_545 = sp.local("compute_CToken_545", sp.record(mantissa = params * sp.as_nat(sp.level - self.data.accrualBlockNumber)))
      sp.set_type(compute_CToken_545.value, sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(compute_CToken_545.value, sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(self.data.totalBorrows, sp.TNat)
      sp.set_type(compute_CToken_545.value.mantissa * self.data.totalBorrows, sp.TNat)
      sp.set_type(sp.record(mantissa = compute_CToken_545.value.mantissa * self.data.totalBorrows), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      compute_CToken_546 = sp.local("compute_CToken_546", (compute_CToken_545.value.mantissa * self.data.totalBorrows) // self.data.expScale)
      self.data.totalBorrows = compute_CToken_546.value + self.data.totalBorrows
      sp.set_type(sp.record(mantissa = self.data.reserveFactorMantissa), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(compute_CToken_546.value, sp.TNat)
      sp.set_type(self.data.totalReserves, sp.TNat)
      sp.set_type(sp.record(mantissa = self.data.reserveFactorMantissa), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(sp.record(mantissa = self.data.reserveFactorMantissa), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(compute_CToken_546.value, sp.TNat)
      sp.set_type(self.data.reserveFactorMantissa * compute_CToken_546.value, sp.TNat)
      sp.set_type(sp.record(mantissa = self.data.reserveFactorMantissa * compute_CToken_546.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      self.data.totalReserves = ((self.data.reserveFactorMantissa * compute_CToken_546.value) // self.data.expScale) + self.data.totalReserves
      sp.set_type(compute_CToken_545.value, sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(self.data.borrowIndex, sp.TNat)
      sp.set_type(self.data.borrowIndex, sp.TNat)
      sp.set_type(compute_CToken_545.value, sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(compute_CToken_545.value, sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(self.data.borrowIndex, sp.TNat)
      sp.set_type(compute_CToken_545.value.mantissa * self.data.borrowIndex, sp.TNat)
      sp.set_type(sp.record(mantissa = compute_CToken_545.value.mantissa * self.data.borrowIndex), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      self.data.borrowIndex = ((compute_CToken_545.value.mantissa * self.data.borrowIndex) // self.data.expScale) + self.data.borrowIndex
      self.data.accrualBlockNumber = sp.level

    @sp.entry_point
    def exchangeRateStored(self, params):
      sp.set_type(sp.fst(params), sp.TUnit)
      excRate = sp.local("excRate", self.data.initialExchangeRateMantissa)
      sp.if self.data.totalSupply > 0:
        sp.set_type(self.data.currentCash, sp.TNat)
        sp.set_type(0, sp.TNat)
        sp.set_type(sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves), sp.TNat)
        sp.set_type(sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale, sp.TNat)
        sp.set_type(sp.record(mantissa = sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        sp.set_type(self.data.totalSupply, sp.TNat)
        sp.verify(self.data.totalSupply > 0, 'DIVISION_BY_ZERO')
        sp.set_type((sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply, sp.TNat)
        excRate.value = (sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply
      __s2 = sp.local("__s2", excRate.value)
      sp.set_type(sp.snd(params), sp.TContract(sp.TNat))
      sp.transfer(__s2.value, sp.tez(0), sp.snd(params))

    @sp.entry_point
    def getAccountSnapshot(self, params):
      sp.set_type(sp.level, sp.TNat)
      sp.set_type(self.data.accrualBlockNumber, sp.TNat)
      compute_CToken_730 = sp.local("compute_CToken_730", sp.as_nat(sp.level - self.data.accrualBlockNumber, message = 'SUBTRACTION_UNDERFLOW'))
      sp.verify(compute_CToken_730.value < self.data.accrualIntPeriodRelevance, 'CT_INTEREST_OLD')
      sp.verify(self.data.isAccrualInterestValid, 'CT_INTEREST_INVALID')
      borrowSnapshot = sp.local("borrowSnapshot", self.data.balances[sp.fst(params)].accountBorrows)
      borrowBalance = sp.local("borrowBalance", 0)
      sp.if borrowSnapshot.value.principal > 0:
        borrowBalance.value = (borrowSnapshot.value.principal * self.data.borrowIndex) // borrowSnapshot.value.interestIndex
      excRate = sp.local("excRate", self.data.initialExchangeRateMantissa)
      sp.if self.data.totalSupply > 0:
        sp.set_type(self.data.currentCash, sp.TNat)
        sp.set_type(0, sp.TNat)
        sp.set_type(sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves), sp.TNat)
        sp.set_type(sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale, sp.TNat)
        sp.set_type(sp.record(mantissa = sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        sp.set_type(self.data.totalSupply, sp.TNat)
        sp.verify(self.data.totalSupply > 0, 'DIVISION_BY_ZERO')
        sp.set_type((sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply, sp.TNat)
        excRate.value = (sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply
      __s3 = sp.local("__s3", sp.record(account = sp.fst(params), borrowBalance = borrowBalance.value, cTokenBalance = self.data.balances[sp.fst(params)].balance, exchangeRateMantissa = excRate.value))
      sp.set_type(sp.snd(params), sp.TContract(sp.TRecord(account = sp.TAddress, borrowBalance = sp.TNat, cTokenBalance = sp.TNat, exchangeRateMantissa = sp.TNat).layout((("account", "borrowBalance"), ("cTokenBalance", "exchangeRateMantissa")))))
      sp.transfer(__s3.value, sp.tez(0), sp.snd(params))

    @sp.entry_point
    def getAllowance(self, params):
      __s4 = sp.local("__s4", self.data.balances[sp.fst(params).owner].approvals[sp.fst(params).spender])
      sp.set_type(sp.snd(params), sp.TContract(sp.TNat))
      sp.transfer(__s4.value, sp.tez(0), sp.snd(params))

    @sp.entry_point
    def getBalance(self, params):
      __s5 = sp.local("__s5", self.data.balances[sp.fst(params)].balance)
      sp.set_type(sp.snd(params), sp.TContract(sp.TNat))
      sp.transfer(__s5.value, sp.tez(0), sp.snd(params))

    @sp.entry_point
    def getBalanceOfUnderlying(self, params):
      sp.set_type(sp.fst(params), sp.TAddress)
      excRate = sp.local("excRate", self.data.initialExchangeRateMantissa)
      sp.if self.data.totalSupply > 0:
        sp.set_type(self.data.currentCash, sp.TNat)
        sp.set_type(0, sp.TNat)
        sp.set_type(sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves), sp.TNat)
        sp.set_type(sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale, sp.TNat)
        sp.set_type(sp.record(mantissa = sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        sp.set_type(self.data.totalSupply, sp.TNat)
        sp.verify(self.data.totalSupply > 0, 'DIVISION_BY_ZERO')
        sp.set_type((sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply, sp.TNat)
        excRate.value = (sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply
      sp.set_type(excRate.value, sp.TNat)
      sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      sp.set_type(self.data.balances[sp.fst(params)].balance, sp.TNat)
      sp.set_type(excRate.value * self.data.balances[sp.fst(params)].balance, sp.TNat)
      sp.set_type(sp.record(mantissa = excRate.value * self.data.balances[sp.fst(params)].balance), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
      __s6 = sp.local("__s6", (excRate.value * self.data.balances[sp.fst(params)].balance) // self.data.expScale)
      sp.set_type(sp.snd(params), sp.TContract(sp.TNat))
      sp.transfer(__s6.value, sp.tez(0), sp.snd(params))

    @sp.entry_point
    def getCash(self, params):
      sp.set_type(sp.fst(params), sp.TUnit)
      __s7 = sp.local("__s7", self.data.currentCash)
      sp.set_type(sp.snd(params), sp.TContract(sp.TNat))
      sp.transfer(__s7.value, sp.tez(0), sp.snd(params))

    @sp.entry_point
    def getTotalSupply(self, params):
      sp.set_type(sp.fst(params), sp.TUnit)
      __s8 = sp.local("__s8", self.data.totalSupply)
      sp.set_type(sp.snd(params), sp.TContract(sp.TNat))
      sp.transfer(__s8.value, sp.tez(0), sp.snd(params))

    @sp.entry_point
    def hardResetOp(self, params):
      sp.set_type(params, sp.TUnit)
      sp.verify(sp.sender == self.data.administrator, 'CT_NOT_ADMIN')
      self.data.activeOperations = sp.set([])

    @sp.entry_point
    def mint(self, params):
      sp.set_type(params, sp.TNat)
      sp.verify(sp.sender != sp.self_address, 'CT_INTERNAL_CALL')
      sp.if ~ (self.data.balances.contains(sp.sender)):
        self.data.balances[sp.sender] = sp.record(accountBorrows = sp.record(interestIndex = 0, principal = 0), approvals = {}, balance = 0)
      sp.transfer(sp.record(cToken = sp.self_address, minter = sp.sender, mintAmount = params), sp.tez(0), sp.contract(sp.TRecord(cToken = sp.TAddress, mintAmount = sp.TNat, minter = sp.TAddress).layout(("cToken", ("minter", "mintAmount"))), self.data.comptroller, entry_point='mintAllowed').open_some())
      sp.set_type(sp.level, sp.TNat)
      sp.set_type(self.data.accrualBlockNumber, sp.TNat)
      compute_CToken_730 = sp.local("compute_CToken_730", sp.as_nat(sp.level - self.data.accrualBlockNumber, message = 'SUBTRACTION_UNDERFLOW'))
      sp.verify(compute_CToken_730.value < self.data.accrualIntPeriodRelevance, 'CT_INTEREST_OLD')
      sp.verify(self.data.isAccrualInterestValid, 'CT_INTEREST_INVALID')
      sp.transfer(sp.list([sp.record(from_ = sp.sender, txs = sp.list([sp.record(to_ = sp.self_address, token_id = self.data.tokenId, amount = params)]))]), sp.tez(0), sp.contract(sp.TList(sp.TRecord(from_ = sp.TAddress, txs = sp.TList(sp.TRecord(amount = sp.TNat, to_ = sp.TAddress, token_id = sp.TNat).layout(("to_", ("token_id", "amount"))))).layout(("from_", "txs"))), self.data.fa2_TokenAddress, entry_point='transfer').open_some())
      excRate = sp.local("excRate", self.data.initialExchangeRateMantissa)
      sp.if self.data.totalSupply > 0:
        sp.set_type(self.data.currentCash, sp.TNat)
        sp.set_type(0, sp.TNat)
        sp.set_type(sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves), sp.TNat)
        sp.set_type(sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale, sp.TNat)
        sp.set_type(sp.record(mantissa = sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        sp.set_type(self.data.totalSupply, sp.TNat)
        sp.verify(self.data.totalSupply > 0, 'DIVISION_BY_ZERO')
        sp.set_type((sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply, sp.TNat)
        excRate.value = (sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply
      amount = sp.local("amount", 0)
      sp.if True:
        sp.set_type(excRate.value, sp.TNat)
        sp.set_type(params, sp.TNat)
        sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        sp.verify(excRate.value > 0, 'DIVISION_BY_ZERO')
        compute_CToken_747 = sp.local("compute_CToken_747", (params * self.data.expScale) // excRate.value)
        amount.value = compute_CToken_747.value
      sp.else:
        sp.set_type(excRate.value, sp.TNat)
        sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        sp.set_type(params, sp.TNat)
        sp.set_type(excRate.value * params, sp.TNat)
        sp.set_type(sp.record(mantissa = excRate.value * params), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
        compute_CToken_749 = sp.local("compute_CToken_749", (excRate.value * params) // self.data.expScale)
        amount.value = compute_CToken_749.value
      self.data.totalSupply += amount.value
      self.data.balances[sp.sender].balance += amount.value
      self.data.isAccrualInterestValid = False

    @sp.entry_point
    def redeem(self, params):
      sp.set_type(params, sp.TNat)
      sp.verify(sp.sender != sp.self_address, 'CT_INTERNAL_CALL')
      sp.transfer(sp.record(cToken = sp.self_address, redeemer = sp.sender, redeemAmount = params), sp.tez(0), sp.contract(sp.TRecord(cToken = sp.TAddress, redeemAmount = sp.TNat, redeemer = sp.TAddress).layout(("cToken", ("redeemer", "redeemAmount"))), self.data.comptroller, entry_point='redeemAllowed').open_some())
      redeem_amount = sp.local("redeem_amount", 0)
      sp.if False:
        redeem_amount.value = params
      sp.else:
        excRate = sp.local("excRate", self.data.initialExchangeRateMantissa)
        sp.if self.data.totalSupply > 0:
          sp.set_type(self.data.currentCash, sp.TNat)
          sp.set_type(0, sp.TNat)
          sp.set_type(sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves), sp.TNat)
          sp.set_type(sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale, sp.TNat)
          sp.set_type(sp.record(mantissa = sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(self.data.totalSupply, sp.TNat)
          sp.verify(self.data.totalSupply > 0, 'DIVISION_BY_ZERO')
          sp.set_type((sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply, sp.TNat)
          excRate.value = (sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply
        amount = sp.local("amount", 0)
        sp.if False:
          sp.set_type(excRate.value, sp.TNat)
          sp.set_type(params, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.verify(excRate.value > 0, 'DIVISION_BY_ZERO')
          compute_CToken_747 = sp.local("compute_CToken_747", (params * self.data.expScale) // excRate.value)
          amount.value = compute_CToken_747.value
        sp.else:
          sp.set_type(excRate.value, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(params, sp.TNat)
          sp.set_type(excRate.value * params, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value * params), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          compute_CToken_749 = sp.local("compute_CToken_749", (excRate.value * params) // self.data.expScale)
          amount.value = compute_CToken_749.value
        redeem_amount.value = amount.value
      redeem_tokens = sp.local("redeem_tokens", 0)
      sp.if False:
        excRate = sp.local("excRate", self.data.initialExchangeRateMantissa)
        sp.if self.data.totalSupply > 0:
          sp.set_type(self.data.currentCash, sp.TNat)
          sp.set_type(0, sp.TNat)
          sp.set_type(sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves), sp.TNat)
          sp.set_type(sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale, sp.TNat)
          sp.set_type(sp.record(mantissa = sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(self.data.totalSupply, sp.TNat)
          sp.verify(self.data.totalSupply > 0, 'DIVISION_BY_ZERO')
          sp.set_type((sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply, sp.TNat)
          excRate.value = (sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply
        amount = sp.local("amount", 0)
        sp.if True:
          sp.set_type(excRate.value, sp.TNat)
          sp.set_type(params, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.verify(excRate.value > 0, 'DIVISION_BY_ZERO')
          compute_CToken_747 = sp.local("compute_CToken_747", (params * self.data.expScale) // excRate.value)
          amount.value = compute_CToken_747.value
        sp.else:
          sp.set_type(excRate.value, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(params, sp.TNat)
          sp.set_type(excRate.value * params, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value * params), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          compute_CToken_749 = sp.local("compute_CToken_749", (excRate.value * params) // self.data.expScale)
          amount.value = compute_CToken_749.value
        redeem_tokens.value = amount.value
      sp.else:
        redeem_tokens.value = params
      sp.verify(self.data.currentCash >= redeem_amount.value, 'CT_INSUFFICIENT_CASH')
      sp.set_type(sp.level, sp.TNat)
      sp.set_type(self.data.accrualBlockNumber, sp.TNat)
      compute_CToken_730 = sp.local("compute_CToken_730", sp.as_nat(sp.level - self.data.accrualBlockNumber, message = 'SUBTRACTION_UNDERFLOW'))
      sp.verify(compute_CToken_730.value < self.data.accrualIntPeriodRelevance, 'CT_INTEREST_OLD')
      sp.verify(self.data.isAccrualInterestValid, 'CT_INTEREST_INVALID')
      self.data.totalSupply = sp.as_nat(self.data.totalSupply - redeem_tokens.value, message = 'Insufficient supply')
      self.data.balances[sp.sender].balance = sp.as_nat(self.data.balances[sp.sender].balance - redeem_tokens.value, message = 'Insufficient balance')
      sp.transfer(sp.list([sp.record(from_ = sp.self_address, txs = sp.list([sp.record(to_ = sp.sender, token_id = self.data.tokenId, amount = redeem_amount.value)]))]), sp.tez(0), sp.contract(sp.TList(sp.TRecord(from_ = sp.TAddress, txs = sp.TList(sp.TRecord(amount = sp.TNat, to_ = sp.TAddress, token_id = sp.TNat).layout(("to_", ("token_id", "amount"))))).layout(("from_", "txs"))), self.data.fa2_TokenAddress, entry_point='transfer').open_some())
      self.data.isAccrualInterestValid = False

    @sp.entry_point
    def redeemUnderlying(self, params):
      sp.set_type(params, sp.TNat)
      sp.verify(sp.sender != sp.self_address, 'CT_INTERNAL_CALL')
      sp.transfer(sp.record(cToken = sp.self_address, redeemer = sp.sender, redeemAmount = params), sp.tez(0), sp.contract(sp.TRecord(cToken = sp.TAddress, redeemAmount = sp.TNat, redeemer = sp.TAddress).layout(("cToken", ("redeemer", "redeemAmount"))), self.data.comptroller, entry_point='redeemAllowed').open_some())
      redeem_amount = sp.local("redeem_amount", 0)
      sp.if True:
        redeem_amount.value = params
      sp.else:
        excRate = sp.local("excRate", self.data.initialExchangeRateMantissa)
        sp.if self.data.totalSupply > 0:
          sp.set_type(self.data.currentCash, sp.TNat)
          sp.set_type(0, sp.TNat)
          sp.set_type(sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves), sp.TNat)
          sp.set_type(sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale, sp.TNat)
          sp.set_type(sp.record(mantissa = sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(self.data.totalSupply, sp.TNat)
          sp.verify(self.data.totalSupply > 0, 'DIVISION_BY_ZERO')
          sp.set_type((sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply, sp.TNat)
          excRate.value = (sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply
        amount = sp.local("amount", 0)
        sp.if False:
          sp.set_type(excRate.value, sp.TNat)
          sp.set_type(params, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.verify(excRate.value > 0, 'DIVISION_BY_ZERO')
          compute_CToken_747 = sp.local("compute_CToken_747", (params * self.data.expScale) // excRate.value)
          amount.value = compute_CToken_747.value
        sp.else:
          sp.set_type(excRate.value, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(params, sp.TNat)
          sp.set_type(excRate.value * params, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value * params), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          compute_CToken_749 = sp.local("compute_CToken_749", (excRate.value * params) // self.data.expScale)
          amount.value = compute_CToken_749.value
        redeem_amount.value = amount.value
      redeem_tokens = sp.local("redeem_tokens", 0)
      sp.if True:
        excRate = sp.local("excRate", self.data.initialExchangeRateMantissa)
        sp.if self.data.totalSupply > 0:
          sp.set_type(self.data.currentCash, sp.TNat)
          sp.set_type(0, sp.TNat)
          sp.set_type(sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves), sp.TNat)
          sp.set_type(sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale, sp.TNat)
          sp.set_type(sp.record(mantissa = sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(self.data.totalSupply, sp.TNat)
          sp.verify(self.data.totalSupply > 0, 'DIVISION_BY_ZERO')
          sp.set_type((sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply, sp.TNat)
          excRate.value = (sp.as_nat((sp.as_nat(self.data.currentCash - 0, message = 'SUBTRACTION_UNDERFLOW') + self.data.totalBorrows) - self.data.totalReserves) * self.data.expScale) // self.data.totalSupply
        amount = sp.local("amount", 0)
        sp.if True:
          sp.set_type(excRate.value, sp.TNat)
          sp.set_type(params, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.verify(excRate.value > 0, 'DIVISION_BY_ZERO')
          compute_CToken_747 = sp.local("compute_CToken_747", (params * self.data.expScale) // excRate.value)
          amount.value = compute_CToken_747.value
        sp.else:
          sp.set_type(excRate.value, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(sp.record(mantissa = excRate.value), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          sp.set_type(params, sp.TNat)
          sp.set_type(excRate.value * params, sp.TNat)
          sp.set_type(sp.record(mantissa = excRate.value * params), sp.TRecord(mantissa = sp.TNat).layout("mantissa"))
          compute_CToken_749 = sp.local("compute_CToken_749", (excRate.value * params) // self.data.expScale)
          amount.value = compute_CToken_749.value
        redeem_tokens.value = amount.value
      sp.else:
        redeem_tokens.value = params
      sp.verify(self.data.currentCash >= redeem_amount.value, 'CT_INSUFFICIENT_CASH')
      sp.set_type(sp.level, sp.TNat)
      sp.set_type(self.data.accrualBlockNumber, sp.TNat)
      compute_CToken_730 = sp.local("compute_CToken_730", sp.as_nat(sp.level - self.data.accrualBlockNumber, message = 'SUBTRACTION_UNDERFLOW'))
      sp.verify(compute_CToken_730.value < self.data.accrualIntPeriodRelevance, 'CT_INTEREST_OLD')
      sp.verify(self.data.isAccrualInterestValid, 'CT_INTEREST_INVALID')
      self.data.totalSupply = sp.as_nat(self.data.totalSupply - redeem_tokens.value, message = 'Insufficient supply')
      self.data.balances[sp.sender].balance = sp.as_nat(self.data.balances[sp.sender].balance - redeem_tokens.value, message = 'Insufficient balance')
      sp.transfer(sp.list([sp.record(from_ = sp.self_address, txs = sp.list([sp.record(to_ = sp.sender, token_id = self.data.tokenId, amount = redeem_amount.value)]))]), sp.tez(0), sp.contract(sp.TList(sp.TRecord(from_ = sp.TAddress, txs = sp.TList(sp.TRecord(amount = sp.TNat, to_ = sp.TAddress, token_id = sp.TNat).layout(("to_", ("token_id", "amount"))))).layout(("from_", "txs"))), self.data.fa2_TokenAddress, entry_point='transfer').open_some())
      self.data.isAccrualInterestValid = False

    @sp.entry_point
    def reduceReserves(self, params):
      sp.set_type(params, sp.TNat)
      sp.verify(sp.sender == self.data.administrator, 'CT_NOT_ADMIN')
      sp.verify(sp.len(self.data.activeOperations) == 0, 'OP_IN_PROGRESS')
      self.data.activeOperations.add(12)
      sp.transfer(sp.unit, sp.tez(0), sp.self_entry_point('accrueInterest'))
      sp.transfer(params, sp.amount, sp.self_entry_point('reduceReservesInternal'))

    @sp.entry_point
    def reduceReservesInternal(self, params):
      sp.verify(sp.sender == sp.self_address, 'CT_INTERNAL_FUNCTION')
      sp.verify(self.data.activeOperations.contains(12), 'OP_NOT_ACTIVE')
      self.data.activeOperations.remove(12)
      sp.verify(self.data.currentCash >= params, 'CT_INSUFFICIENT_CASH')
      sp.verify(params <= self.data.totalReserves, 'CT_REDUCE_AMOUNT')
      sp.set_type(self.data.totalReserves, sp.TNat)
      sp.set_type(params, sp.TNat)
      self.data.totalReserves = sp.as_nat(self.data.totalReserves - params, message = 'SUBTRACTION_UNDERFLOW')
      sp.transfer(sp.list([sp.record(from_ = sp.self_address, txs = sp.list([sp.record(to_ = self.data.administrator, token_id = self.data.tokenId, amount = params)]))]), sp.tez(0), sp.contract(sp.TList(sp.TRecord(from_ = sp.TAddress, txs = sp.TList(sp.TRecord(amount = sp.TNat, to_ = sp.TAddress, token_id = sp.TNat).layout(("to_", ("token_id", "amount"))))).layout(("from_", "txs"))), self.data.fa2_TokenAddress, entry_point='transfer').open_some())
      self.data.isAccrualInterestValid = False

    @sp.entry_point
    def removePendingGovernance(self, params):
      sp.set_type(params, sp.TUnit)
      sp.verify(sp.sender == self.data.administrator, 'CT_NOT_ADMIN')
      self.data.pendingAdministrator = sp.none

    @sp.entry_point
    def repayBorrow(self, params):
      sp.set_type(params, sp.TNat)
      sp.verify(sp.sender != sp.self_address, 'CT_INTERNAL_CALL')
      sp.if ~ (self.data.balances.contains(sp.sender)):
        self.data.balances[sp.sender] = sp.record(accountBorrows = sp.record(interestIndex = 0, principal = 0), approvals = {}, balance = 0)
      sp.transfer(sp.record(cToken = sp.self_address, payer = sp.sender, borrower = sp.sender, repayAmount = params), sp.tez(0), sp.contract(sp.TRecord(borrower = sp.TAddress, cToken = sp.TAddress, payer = sp.TAddress, repayAmount = sp.TNat).layout(("cToken", ("payer", ("borrower", "repayAmount")))), self.data.comptroller, entry_point='repayBorrowAllowed').open_some())
      sp.set_type(sp.level, sp.TNat)
      sp.set_type(self.data.accrualBlockNumber, sp.TNat)
      compute_CToken_730 = sp.local("compute_CToken_730", sp.as_nat(sp.level - self.data.accrualBlockNumber, message = 'SUBTRACTION_UNDERFLOW'))
      sp.verify(compute_CToken_730.value < self.data.accrualIntPeriodRelevance, 'CT_INTEREST_OLD')
      sp.verify(self.data.isAccrualInterestValid, 'CT_INTEREST_INVALID')
      borrowSnapshot = sp.local("borrowSnapshot", self.data.balances[sp.sender].accountBorrows)
      borrowBalance = sp.local("borrowBalance", 0)
      sp.if borrowSnapshot.value.principal > 0:
        borrowBalance.value = (borrowSnapshot.value.principal * self.data.borrowIndex) // borrowSnapshot.value.interestIndex
      sp.transfer(sp.list([sp.record(from_ = sp.sender, txs = sp.list([sp.record(to_ = sp.self_address, token_id = self.data.tokenId, amount = sp.min(borrowBalance.value, params))]))]), sp.tez(0), sp.contract(sp.TList(sp.TRecord(from_ = sp.TAddress, txs = sp.TList(sp.TRecord(amount = sp.TNat, to_ = sp.TAddress, token_id = sp.TNat).layout(("to_", ("token_id", "amount"))))).layout(("from_", "txs"))), self.data.fa2_TokenAddress, entry_point='transfer').open_some())
      sp.set_type(borrowBalance.value, sp.TNat)
      sp.set_type(sp.min(borrowBalance.value, params), sp.TNat)
      self.data.balances[sp.sender].accountBorrows.principal = sp.as_nat(borrowBalance.value - sp.min(borrowBalance.value, params), message = 'SUBTRACTION_UNDERFLOW')
      self.data.balances[sp.sender].accountBorrows.interestIndex = self.data.borrowIndex
      sp.set_type(self.data.totalBorrows, sp.TNat)
      sp.set_type(sp.min(borrowBalance.value, params), sp.TNat)
      self.data.totalBorrows = sp.as_nat(self.data.totalBorrows - sp.min(borrowBalance.value, params), message = 'SUBTRACTION_UNDERFLOW')
      self.data.isAccrualInterestValid = False

    @sp.entry_point
    def repayBorrowBehalf(self, params):
      sp.set_type(params, sp.TRecord(borrower = sp.TAddress, repayAmount = sp.TNat).layout(("borrower", "repayAmount")))
      sp.verify(sp.sender != sp.self_address, 'CT_INTERNAL_CALL')
      sp.if ~ (self.data.balances.contains(sp.sender)):
        self.data.balances[sp.sender] = sp.record(accountBorrows = sp.record(interestIndex = 0, principal = 0), approvals = {}, balance = 0)
      sp.transfer(sp.record(cToken = sp.self_address, payer = sp.sender, borrower = params.borrower, repayAmount = params.repayAmount), sp.tez(0), sp.contract(sp.TRecord(borrower = sp.TAddress, cToken = sp.TAddress, payer = sp.TAddress, repayAmount = sp.TNat).layout(("cToken", ("payer", ("borrower", "repayAmount")))), self.data.comptroller, entry_point='repayBorrowAllowed').open_some())
      sp.set_type(sp.level, sp.TNat)
      sp.set_type(self.data.accrualBlockNumber, sp.TNat)
      compute_CToken_730 = sp.local("compute_CToken_730", sp.as_nat(sp.level - self.data.accrualBlockNumber, message = 'SUBTRACTION_UNDERFLOW'))
      sp.verify(compute_CToken_730.value < self.data.accrualIntPeriodRelevance, 'CT_INTEREST_OLD')
      sp.verify(self.data.isAccrualInterestValid, 'CT_INTEREST_INVALID')
      borrowSnapshot = sp.local("borrowSnapshot", self.data.balances[params.borrower].accountBorrows)
      borrowBalance = sp.local("borrowBalance", 0)
      sp.if borrowSnapshot.value.principal > 0:
        borrowBalance.value = (borrowSnapshot.value.principal * self.data.borrowIndex) // borrowSnapshot.value.interestIndex
      sp.transfer(sp.list([sp.record(from_ = sp.sender, txs = sp.list([sp.record(to_ = sp.self_address, token_id = self.data.tokenId, amount = sp.min(borrowBalance.value, params.repayAmount))]))]), sp.tez(0), sp.contract(sp.TList(sp.TRecord(from_ = sp.TAddress, txs = sp.TList(sp.TRecord(amount = sp.TNat, to_ = sp.TAddress, token_id = sp.TNat).layout(("to_", ("token_id", "amount"))))).layout(("from_", "txs"))), self.data.fa2_TokenAddress, entry_point='transfer').open_some())
      sp.set_type(borrowBalance.value, sp.TNat)
      sp.set_type(sp.min(borrowBalance.value, params.repayAmount), sp.TNat)
      self.data.balances[params.borrower].accountBorrows.principal = sp.as_nat(borrowBalance.value - sp.min(borrowBalance.value, params.repayAmount), message = 'SUBTRACTION_UNDERFLOW')
      self.data.balances[params.borrower].accountBorrows.interestIndex = self.data.borrowIndex
      sp.set_type(self.data.totalBorrows, sp.TNat)
      sp.set_type(sp.min(borrowBalance.value, params.repayAmount), sp.TNat)
      self.data.totalBorrows = sp.as_nat(self.data.totalBorrows - sp.min(borrowBalance.value, params.repayAmount), message = 'SUBTRACTION_UNDERFLOW')
      self.data.isAccrualInterestValid = False

    @sp.entry_point
    def setAccrualIntPeriodRelevance(self, params):
      sp.verify(sp.sender == self.data.administrator, 'CT_NOT_ADMIN')
      sp.set_type(params, sp.TNat)
      self.data.accrualIntPeriodRelevance = params

    @sp.entry_point
    def setBorrowRatePerBlock(self, params):
      sp.verify(sp.sender == self.data.interestRateModel, 'CT_SENDER_NOT_IRM')
      sp.verify(self.data.activeOperations.contains(6), 'OP_NOT_ACTIVE')
      self.data.activeOperations.remove(6)
      self.data.borrowRatePerBlock = params

    @sp.entry_point
    def setCash(self, params):
      sp.set_type(params, sp.TList(sp.TRecord(balance = sp.TNat, request = sp.TRecord(owner = sp.TAddress, token_id = sp.TNat).layout(("owner", "token_id"))).layout(("request", "balance"))))
      sp.verify(self.data.activeOperations.contains(13), 'OP_NOT_ACTIVE')
      self.data.activeOperations.remove(13)
      sp.verify(sp.sender == self.data.fa2_TokenAddress, 'CT_INVALID_CASH_SENDER')
      sp.verify(sp.len(params) == 1, 'CT_INVALID_CASH_DATA')
      sp.for cash in params:
        sp.verify(cash.request.token_id == self.data.tokenId, 'CT_INVALID_CASH_DATA')
        sp.verify(cash.request.owner == sp.self_address, 'CT_INVALID_CASH_DATA')
        self.data.currentCash = cash.balance

    @sp.entry_point
    def setComptroller(self, params):
      sp.set_type(params, sp.TAddress)
      sp.verify(sp.sender == self.data.administrator, 'CT_NOT_ADMIN')
      self.data.comptroller = params

    @sp.entry_point
    def setInterestRateModel(self, params):
      sp.set_type(params, sp.TAddress)
      sp.verify(sp.sender == self.data.administrator, 'CT_NOT_ADMIN')
      sp.verify(sp.len(self.data.activeOperations) == 0, 'OP_IN_PROGRESS')
      self.data.activeOperations.add(9)
      sp.transfer(sp.unit, sp.tez(0), sp.self_entry_point('accrueInterest'))
      sp.transfer(params, sp.tez(0), sp.self_entry_point('setInterestRateModelInternal'))

    @sp.entry_point
    def setInterestRateModelInternal(self, params):
      sp.set_type(params, sp.TAddress)
      sp.verify(sp.sender == sp.self_address, 'CT_INTERNAL_FUNCTION')
      sp.verify(self.data.activeOperations.contains(9), 'OP_NOT_ACTIVE')
      self.data.activeOperations.remove(9)
      self.data.interestRateModel = params

    @sp.entry_point
    def setPendingGovernance(self, params):
      sp.set_type(params, sp.TAddress)
      sp.verify(sp.sender == self.data.administrator, 'CT_NOT_ADMIN')
      self.data.pendingAdministrator = sp.some(params)

    @sp.entry_point
    def setReserveFactor(self, params):
      sp.set_type(params, sp.TNat)
      sp.verify(sp.sender == self.data.administrator, 'CT_NOT_ADMIN')
      sp.verify(sp.len(self.data.activeOperations) == 0, 'OP_IN_PROGRESS')
      self.data.activeOperations.add(10)
      sp.transfer(sp.unit, sp.tez(0), sp.self_entry_point('accrueInterest'))
      sp.transfer(params, sp.tez(0), sp.self_entry_point('setReserveFactorInternal'))

    @sp.entry_point
    def setReserveFactorInternal(self, params):
      sp.verify(sp.sender == sp.self_address, 'CT_INTERNAL_FUNCTION')
      sp.verify(self.data.activeOperations.contains(10), 'OP_NOT_ACTIVE')
      self.data.activeOperations.remove(10)
      sp.set_type(sp.level, sp.TNat)
      sp.set_type(self.data.accrualBlockNumber, sp.TNat)
      compute_CToken_730 = sp.local("compute_CToken_730", sp.as_nat(sp.level - self.data.accrualBlockNumber, message = 'SUBTRACTION_UNDERFLOW'))
      sp.verify(compute_CToken_730.value < self.data.accrualIntPeriodRelevance, 'CT_INTEREST_OLD')
      sp.verify(self.data.isAccrualInterestValid, 'CT_INTEREST_INVALID')
      sp.verify(params <= self.data.reserveFactorMaxMantissa, 'CT_INVALID_RESERVE_FACTOR')
      self.data.reserveFactorMantissa = params
      self.data.isAccrualInterestValid = False

    @sp.entry_point
    def setSupplyRatePerBlock(self, params):
      sp.verify(sp.sender == self.data.interestRateModel, 'CT_SENDER_NOT_IRM')
      sp.verify(self.data.activeOperations.contains(7), 'OP_NOT_ACTIVE')
      self.data.activeOperations.remove(7)
      self.data.supplyRatePerBlock = params

    @sp.entry_point
    def sweepFA12(self, params):
      sp.set_type(params, sp.TRecord(amount = sp.TNat, tokenAddress = sp.TAddress).layout(("amount", "tokenAddress")))
      sp.transfer(sp.record(from_ = sp.self_address, to_ = self.data.administrator, value = params.amount), sp.tez(0), sp.contract(sp.TRecord(from_ = sp.TAddress, to_ = sp.TAddress, value = sp.TNat).layout(("from_ as from", ("to_ as to", "value"))), params.tokenAddress, entry_point='transfer').open_some())

    @sp.entry_point
    def sweepFA2(self, params):
      sp.set_type(params, sp.TRecord(amount = sp.TNat, id = sp.TNat, tokenAddress = sp.TAddress).layout(("amount", ("id", "tokenAddress"))))
      sp.verify((params.tokenAddress != self.data.fa2_TokenAddress) | (params.id != self.data.tokenId), 'CT_SWEEP_UNDERLYING')
      sp.transfer(sp.list([sp.record(from_ = sp.self_address, txs = sp.list([sp.record(to_ = self.data.administrator, token_id = params.id, amount = params.amount)]))]), sp.tez(0), sp.contract(sp.TList(sp.TRecord(from_ = sp.TAddress, txs = sp.TList(sp.TRecord(amount = sp.TNat, to_ = sp.TAddress, token_id = sp.TNat).layout(("to_", ("token_id", "amount"))))).layout(("from_", "txs"))), params.tokenAddress, entry_point='transfer').open_some())

    @sp.entry_point
    def sweepMutez(self, params):
      sp.set_type(params, sp.TBool)
      sp.if params:
        sp.send(self.data.administrator, sp.balance)
      sp.else:
        sp.send(self.data.administrator, sp.balance)

    @sp.entry_point
    def transfer(self, params):
      sp.set_type(params, sp.TRecord(from_ = sp.TAddress, to_ = sp.TAddress, value = sp.TNat).layout(("from_ as from", ("to_ as to", "value"))))
      sp.verify((params.from_ == sp.sender) | (self.data.balances[params.from_].approvals[sp.sender] >= params.value), 'CT_TRANSFER_NOT_APPROVED')
      sp.if ~ (self.data.balances.contains(params.to_)):
        self.data.balances[params.to_] = sp.record(accountBorrows = sp.record(interestIndex = 0, principal = 0), approvals = {}, balance = 0)
      sp.transfer(sp.record(cToken = sp.self_address, src = params.from_, dst = params.to_, transferTokens = params.value), sp.tez(0), sp.contract(sp.TRecord(cToken = sp.TAddress, dst = sp.TAddress, src = sp.TAddress, transferTokens = sp.TNat).layout((("cToken", "src"), ("dst", "transferTokens"))), self.data.comptroller, entry_point='transferAllowed').open_some())
      sp.set_type(sp.record(from_ = params.from_, sender = sp.sender, to_ = params.to_, value = params.value), sp.TRecord(from_ = sp.TAddress, sender = sp.TAddress, to_ = sp.TAddress, value = sp.TNat).layout((("from_", "sender"), ("to_", "value"))))
      sp.verify(self.data.balances[params.from_].balance >= params.value, 'CT_INSUFFICIENT_BALANCE')
      self.data.balances[params.from_].balance = sp.as_nat(self.data.balances[params.from_].balance - params.value)
      self.data.balances[params.to_].balance += params.value
      sp.if params.from_ != sp.sender:
        self.data.balances[params.from_].approvals[sp.sender] = sp.as_nat(self.data.balances[params.from_].approvals[sp.sender] - params.value)

    @sp.entry_point
    def updateBorrowRateInternal(self, params):
      sp.set_type(params, sp.TUnit)
      sp.verify(sp.sender == sp.self_address, 'CT_INTERNAL_FUNCTION')
      sp.verify(self.data.activeOperations.contains(6), 'OP_NOT_ACTIVE')
      sp.transfer(sp.record(borrows = self.data.totalBorrows, cash = self.data.currentCash, cb = sp.self_entry_point('setBorrowRatePerBlock'), reserves = self.data.totalReserves), sp.tez(0), sp.contract(sp.TRecord(borrows = sp.TNat, cash = sp.TNat, cb = sp.TContract(sp.TNat), reserves = sp.TNat).layout((("borrows", "cash"), ("cb", "reserves"))), self.data.interestRateModel, entry_point='getBorrowRate').open_some())

    @sp.entry_point
    def updateBorrowRatePerBlock(self, params):
      sp.set_type(params, sp.TUnit)
      sp.verify(sp.len(self.data.activeOperations) == 0, 'OP_IN_PROGRESS')
      self.data.activeOperations.add(6)
      compute_CFA2_43 = sp.local("compute_CFA2_43", (self.data.currentCash + self.data.totalSupply) + self.data.totalReserves)
      sp.if compute_CFA2_43.value > 0:
        self.data.activeOperations.add(13)
        sp.transfer(sp.record(requests = sp.list([sp.record(owner = sp.self_address, token_id = self.data.tokenId)]), callback = sp.self_entry_point('setCash')), sp.tez(0), sp.contract(sp.TRecord(callback = sp.TContract(sp.TList(sp.TRecord(balance = sp.TNat, request = sp.TRecord(owner = sp.TAddress, token_id = sp.TNat).layout(("owner", "token_id"))).layout(("request", "balance")))), requests = sp.TList(sp.TRecord(owner = sp.TAddress, token_id = sp.TNat).layout(("owner", "token_id")))).layout(("requests", "callback")), self.data.fa2_TokenAddress, entry_point='balance_of').open_some())
      sp.transfer(sp.unit, sp.tez(0), sp.self_entry_point('updateBorrowRateInternal'))

    @sp.entry_point
    def updateSupplyRateInternal(self, params):
      sp.set_type(params, sp.TUnit)
      sp.verify(sp.sender == sp.self_address, 'CT_INTERNAL_FUNCTION')
      sp.verify(self.data.activeOperations.contains(7), 'OP_NOT_ACTIVE')
      sp.transfer(sp.record(borrows = self.data.totalBorrows, cash = self.data.currentCash, cb = sp.self_entry_point('setSupplyRatePerBlock'), reserves = self.data.totalReserves), sp.tez(0), sp.contract(sp.TRecord(borrows = sp.TNat, cash = sp.TNat, cb = sp.TContract(sp.TNat), reserves = sp.TNat).layout((("borrows", "cash"), ("cb", "reserves"))), self.data.interestRateModel, entry_point='getSupplyRate').open_some())

    @sp.entry_point
    def updateSupplyRatePerBlock(self, params):
      sp.set_type(params, sp.TUnit)
      sp.verify(sp.len(self.data.activeOperations) == 0, 'OP_IN_PROGRESS')
      self.data.activeOperations.add(7)
      compute_CFA2_43 = sp.local("compute_CFA2_43", (self.data.currentCash + self.data.totalSupply) + self.data.totalReserves)
      sp.if compute_CFA2_43.value > 0:
        self.data.activeOperations.add(13)
        sp.transfer(sp.record(requests = sp.list([sp.record(owner = sp.self_address, token_id = self.data.tokenId)]), callback = sp.self_entry_point('setCash')), sp.tez(0), sp.contract(sp.TRecord(callback = sp.TContract(sp.TList(sp.TRecord(balance = sp.TNat, request = sp.TRecord(owner = sp.TAddress, token_id = sp.TNat).layout(("owner", "token_id"))).layout(("request", "balance")))), requests = sp.TList(sp.TRecord(owner = sp.TAddress, token_id = sp.TNat).layout(("owner", "token_id")))).layout(("requests", "callback")), self.data.fa2_TokenAddress, entry_point='balance_of').open_some())
      sp.transfer(sp.unit, sp.tez(0), sp.self_entry_point('updateSupplyRateInternal'))

    Check transferIn

    Try mint not as operator

    Transaction

    Transaction [OK] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TokenId TotalBorrows TotalReserves TotalSupply
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    Key AccountBorrows Approvals Balance
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HKT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFTrue
    ()
    Transaction

    Transaction [OK] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H

    Address Amount Metadata Token_id
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    Key Value
    'decimals'0x32
    'name'0x54686520546f6b656e205a65726f
    'symbol'0x544b30

    Balance: 0.000000tz

    Operations:

    Storage:

    Administrator All_tokens Ledger Metadata Operators Paused Token_metadata Total_supply
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    Key Balance
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    Key Value
    ''0x68747470733a2f2f6578616d706c652e636f6d
    Key Value
    False
    Key Token_id Token_info
    Key Value
    'decimals'0x32
    'name'0x54686520546f6b656e205a65726f
    'symbol'0x544b30
    Key Value
    ()
    Reverted transaction
    Transaction

    Transaction [OK] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TRecord(cToken = sp.TAddress, mintAmount = sp.TNat, minter = sp.TAddress).layout(("cToken", ("minter", "mintAmount"))), KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1).open_some()
    CToken Minter MintAmount
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    Transfer 0.000000tz to sp.contract(sp.TList(sp.TRecord(from_ = sp.TAddress, txs = sp.TList(sp.TRecord(amount = sp.TNat, to_ = sp.TAddress, token_id = sp.TNat).layout(("to_", ("token_id", "amount"))))).layout(("from_", "txs"))), KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H).open_some()
    From_ Txs
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    Amount To_ Token_id
    100KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv30

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TokenId TotalBorrows TotalReserves TotalSupply
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    Key AccountBorrows Approvals Balance
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    InterestIndex Principal
    Key Value
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HKT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFFalse
    ()
    Transaction
    Follow-up-transfer: KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1%mintAllowed (sp.record(cToken = s...)

    Transaction [OK] by [KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    CToken Minter MintAmount
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi

    Balance: 0.000000tz

    Operations:

    Storage:

    Borrow_allowed Mint_allowed Redeem_allowed Repay_borrow_allowed
    TrueTrueTrueTrue
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H%transfer (sp.list([sp.record(f...)

    Transaction [KO] by [KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3] at time [timestamp(0)] to KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H

    From_ Txs
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    Amount To_ Token_id
    100KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv30

    Balance: 0.000000tz

    Error:

    Wrong condition:
    Message: 'FA2_NOT_OPERATOR'
    ()

    Mint as operator

    Transaction

    Transaction [OK] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H

    Owner Operator Token_id
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1GwiKT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Storage:

    Administrator All_tokens Ledger Metadata Operators Paused Token_metadata Total_supply
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    Key Balance
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    Key Value
    ''0x68747470733a2f2f6578616d706c652e636f6d
    Key Value
    Owner Operator Token_id
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1GwiKT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3
    False
    Key Token_id Token_info
    Key Value
    'decimals'0x32
    'name'0x54686520546f6b656e205a65726f
    'symbol'0x544b30
    Key Value
    ()
    Multiple operations
    Transaction

    Transaction [OK] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TRecord(borrows = sp.TNat, cash = sp.TNat, cb = sp.TContract(sp.TNat), reserves = sp.TNat).layout((("borrows", "cash"), ("cb", "reserves"))), KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF).open_some()
    Borrows Cash Cb Reserves
    sp.contract(sp.TNat, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TokenId TotalBorrows TotalReserves TotalSupply
    8
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    Key AccountBorrows Approvals Balance
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HKT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFTrue
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF%getBorrowRate (sp.record(borrows = ...)

    Transaction [OK] by [KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3] at time [timestamp(0)] to KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    Borrows Cash Cb Reserves
    sp.contract(sp.TNat, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TNat, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()

    Storage:

    BorrowRate SupplyRate
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%doAccrueInterest (840000000000) (Follow-up-transfer: KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF%getBorrowRate (sp.record(borrows = ...))

    Transaction [OK] by [KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TokenId TotalBorrows TotalReserves TotalSupply
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    Key AccountBorrows Approvals Balance
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HKT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFTrue
    ()
    Multiple operations
    Transaction

    Transaction [OK] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TRecord(cToken = sp.TAddress, mintAmount = sp.TNat, minter = sp.TAddress).layout(("cToken", ("minter", "mintAmount"))), KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1).open_some()
    CToken Minter MintAmount
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    Transfer 0.000000tz to sp.contract(sp.TList(sp.TRecord(from_ = sp.TAddress, txs = sp.TList(sp.TRecord(amount = sp.TNat, to_ = sp.TAddress, token_id = sp.TNat).layout(("to_", ("token_id", "amount"))))).layout(("from_", "txs"))), KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H).open_some()
    From_ Txs
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    Amount To_ Token_id
    100KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv30

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TokenId TotalBorrows TotalReserves TotalSupply
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    Key AccountBorrows Approvals Balance
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    InterestIndex Principal
    Key Value
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HKT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFFalse
    ()
    Transaction
    Follow-up-transfer: KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1%mintAllowed (sp.record(cToken = s...)

    Transaction [OK] by [KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    CToken Minter MintAmount
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi

    Balance: 0.000000tz

    Operations:

    Storage:

    Borrow_allowed Mint_allowed Redeem_allowed Repay_borrow_allowed
    TrueTrueTrueTrue
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H%transfer (sp.list([sp.record(f...)

    Transaction [OK] by [KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3] at time [timestamp(0)] to KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H

    From_ Txs
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    Amount To_ Token_id
    100KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv30

    Balance: 0.000000tz

    Operations:

    Storage:

    Administrator All_tokens Ledger Metadata Operators Paused Token_metadata Total_supply
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    Key Balance
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    Key Value
    ''0x68747470733a2f2f6578616d706c652e636f6d
    Key Value
    Owner Operator Token_id
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1GwiKT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3
    False
    Key Token_id Token_info
    Key Value
    'decimals'0x32
    'name'0x54686520546f6b656e205a65726f
    'symbol'0x544b30
    Key Value
    ()

    Second mint

    Multiple operations
    Transaction

    Transaction [OK] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TRecord(callback = sp.TContract(sp.TList(sp.TRecord(balance = sp.TNat, request = sp.TRecord(owner = sp.TAddress, token_id = sp.TNat).layout(("owner", "token_id"))).layout(("request", "balance")))), requests = sp.TList(sp.TRecord(owner = sp.TAddress, token_id = sp.TNat).layout(("owner", "token_id")))).layout(("requests", "callback")), KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H).open_some()
    Requests Callback
    Owner Token_id
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv30
    sp.contract(sp.TList(sp.TRecord(balance = sp.TNat, request = sp.TRecord(owner = sp.TAddress, token_id = sp.TNat).layout(("owner", "token_id"))).layout(("request", "balance"))), KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()
    Transfer 0.000000tz to sp.contract(sp.TRecord(borrows = sp.TNat, cash = sp.TNat, cb = sp.TContract(sp.TNat), reserves = sp.TNat).layout((("borrows", "cash"), ("cb", "reserves"))), KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF).open_some()
    Borrows Cash Cb Reserves
    sp.contract(sp.TNat, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TokenId TotalBorrows TotalReserves TotalSupply
    8
    13
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    Key AccountBorrows Approvals Balance
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    InterestIndex Principal
    Key Value
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HKT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFTrue
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H%balance_of (sp.record(requests =...)

    Transaction [OK] by [KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3] at time [timestamp(0)] to KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H

    Requests Callback
    Owner Token_id
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv30
    sp.contract(sp.TList(sp.TRecord(balance = sp.TNat, request = sp.TRecord(owner = sp.TAddress, token_id = sp.TNat).layout(("owner", "token_id"))).layout(("request", "balance"))), KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TList(sp.TRecord(balance = sp.TNat, request = sp.TRecord(owner = sp.TAddress, token_id = sp.TNat).layout(("owner", "token_id"))).layout(("request", "balance"))), KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()
    Balance Request
    100
    Owner Token_id
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Storage:

    Administrator All_tokens Ledger Metadata Operators Paused Token_metadata Total_supply
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    Key Balance
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    Key Value
    ''0x68747470733a2f2f6578616d706c652e636f6d
    Key Value
    Owner Operator Token_id
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1GwiKT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3
    False
    Key Token_id Token_info
    Key Value
    'decimals'0x32
    'name'0x54686520546f6b656e205a65726f
    'symbol'0x544b30
    Key Value
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%setCash (sp.list([sp.record(r...) (Follow-up-transfer: KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H%balance_of (sp.record(requests =...))

    Transaction [OK] by [KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance Request
    100
    Owner Token_id
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TokenId TotalBorrows TotalReserves TotalSupply
    8
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    Key AccountBorrows Approvals Balance
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    InterestIndex Principal
    Key Value
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HKT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFTrue
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF%getBorrowRate (sp.record(borrows = ...)

    Transaction [OK] by [KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3] at time [timestamp(0)] to KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    Borrows Cash Cb Reserves
    sp.contract(sp.TNat, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TNat, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()

    Storage:

    BorrowRate SupplyRate
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%doAccrueInterest (840000000000) (Follow-up-transfer: KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF%getBorrowRate (sp.record(borrows = ...))

    Transaction [OK] by [KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TokenId TotalBorrows TotalReserves TotalSupply
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    Key AccountBorrows Approvals Balance
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    InterestIndex Principal
    Key Value
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HKT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFTrue
    ()
    Multiple operations
    Transaction

    Transaction [OK] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TRecord(cToken = sp.TAddress, mintAmount = sp.TNat, minter = sp.TAddress).layout(("cToken", ("minter", "mintAmount"))), KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1).open_some()
    CToken Minter MintAmount
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    Transfer 0.000000tz to sp.contract(sp.TList(sp.TRecord(from_ = sp.TAddress, txs = sp.TList(sp.TRecord(amount = sp.TNat, to_ = sp.TAddress, token_id = sp.TNat).layout(("to_", ("token_id", "amount"))))).layout(("from_", "txs"))), KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H).open_some()
    From_ Txs
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    Amount To_ Token_id
    100KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv30

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TokenId TotalBorrows TotalReserves TotalSupply
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    Key AccountBorrows Approvals Balance
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    InterestIndex Principal
    Key Value
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HKT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFFalse
    ()
    Transaction
    Follow-up-transfer: KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1%mintAllowed (sp.record(cToken = s...)

    Transaction [OK] by [KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    CToken Minter MintAmount
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi

    Balance: 0.000000tz

    Operations:

    Storage:

    Borrow_allowed Mint_allowed Redeem_allowed Repay_borrow_allowed
    TrueTrueTrueTrue
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H%transfer (sp.list([sp.record(f...)

    Transaction [OK] by [KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3] at time [timestamp(0)] to KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H

    From_ Txs
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    Amount To_ Token_id
    100KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv30

    Balance: 0.000000tz

    Operations:

    Storage:

    Administrator All_tokens Ledger Metadata Operators Paused Token_metadata Total_supply
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    Key Balance
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    Key Value
    ''0x68747470733a2f2f6578616d706c652e636f6d
    Key Value
    Owner Operator Token_id
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1GwiKT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3
    False
    Key Token_id Token_info
    Key Value
    'decimals'0x32
    'name'0x54686520546f6b656e205a65726f
    'symbol'0x544b30
    Key Value
    ()

    Try mint with no cash

    Reverted transaction
    Transaction

    Transaction [KO] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Error:

    Wrong condition:
    Message: 'CT_INTEREST_INVALID'
    ()

    Check getCash

    Before accrueInterest

    Multiple operations
    Transaction

    Transaction [OK] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    sp.contract(sp.TNat, KT1Tezooo3zzSmartPyzzSTATiCzzzseJjWC).open_some()

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TNat, KT1Tezooo3zzSmartPyzzSTATiCzzzseJjWC).open_some()

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TokenId TotalBorrows TotalReserves TotalSupply
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    Key AccountBorrows Approvals Balance
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    InterestIndex Principal
    Key Value
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HKT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFFalse
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo3zzSmartPyzzSTATiCzzzseJjWC%targetNat (100)

    Transaction [OK] by [KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3] at time [timestamp(0)] to KT1Tezooo3zzSmartPyzzSTATiCzzzseJjWC

    Balance: 0.000000tz

    Operations:

    Storage:

    Last
    ()

    After accrueInterest

    Multiple operations
    Transaction

    Transaction [OK] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TRecord(callback = sp.TContract(sp.TList(sp.TRecord(balance = sp.TNat, request = sp.TRecord(owner = sp.TAddress, token_id = sp.TNat).layout(("owner", "token_id"))).layout(("request", "balance")))), requests = sp.TList(sp.TRecord(owner = sp.TAddress, token_id = sp.TNat).layout(("owner", "token_id")))).layout(("requests", "callback")), KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H).open_some()
    Requests Callback
    Owner Token_id
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv30
    sp.contract(sp.TList(sp.TRecord(balance = sp.TNat, request = sp.TRecord(owner = sp.TAddress, token_id = sp.TNat).layout(("owner", "token_id"))).layout(("request", "balance"))), KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()
    Transfer 0.000000tz to sp.contract(sp.TRecord(borrows = sp.TNat, cash = sp.TNat, cb = sp.TContract(sp.TNat), reserves = sp.TNat).layout((("borrows", "cash"), ("cb", "reserves"))), KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF).open_some()
    Borrows Cash Cb Reserves
    sp.contract(sp.TNat, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TokenId TotalBorrows TotalReserves TotalSupply
    8
    13
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    Key AccountBorrows Approvals Balance
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    InterestIndex Principal
    Key Value
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HKT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFTrue
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H%balance_of (sp.record(requests =...)

    Transaction [OK] by [KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3] at time [timestamp(0)] to KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H

    Requests Callback
    Owner Token_id
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv30
    sp.contract(sp.TList(sp.TRecord(balance = sp.TNat, request = sp.TRecord(owner = sp.TAddress, token_id = sp.TNat).layout(("owner", "token_id"))).layout(("request", "balance"))), KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TList(sp.TRecord(balance = sp.TNat, request = sp.TRecord(owner = sp.TAddress, token_id = sp.TNat).layout(("owner", "token_id"))).layout(("request", "balance"))), KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()
    Balance Request
    200
    Owner Token_id
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Storage:

    Administrator All_tokens Ledger Metadata Operators Paused Token_metadata Total_supply
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    Key Balance
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    Key Value
    ''0x68747470733a2f2f6578616d706c652e636f6d
    Key Value
    Owner Operator Token_id
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1GwiKT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3
    False
    Key Token_id Token_info
    Key Value
    'decimals'0x32
    'name'0x54686520546f6b656e205a65726f
    'symbol'0x544b30
    Key Value
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%setCash (sp.list([sp.record(r...) (Follow-up-transfer: KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H%balance_of (sp.record(requests =...))

    Transaction [OK] by [KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance Request
    200
    Owner Token_id
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TokenId TotalBorrows TotalReserves TotalSupply
    8
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    Key AccountBorrows Approvals Balance
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    InterestIndex Principal
    Key Value
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HKT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFTrue
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF%getBorrowRate (sp.record(borrows = ...)

    Transaction [OK] by [KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3] at time [timestamp(0)] to KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    Borrows Cash Cb Reserves
    sp.contract(sp.TNat, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TNat, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()

    Storage:

    BorrowRate SupplyRate
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%doAccrueInterest (840000000000) (Follow-up-transfer: KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF%getBorrowRate (sp.record(borrows = ...))

    Transaction [OK] by [KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TokenId TotalBorrows TotalReserves TotalSupply
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    Key AccountBorrows Approvals Balance
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    InterestIndex Principal
    Key Value
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HKT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFTrue
    ()
    Multiple operations
    Transaction

    Transaction [OK] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    sp.contract(sp.TNat, KT1Tezooo3zzSmartPyzzSTATiCzzzseJjWC).open_some()

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TNat, KT1Tezooo3zzSmartPyzzSTATiCzzzseJjWC).open_some()

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TokenId TotalBorrows TotalReserves TotalSupply
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    Key AccountBorrows Approvals Balance
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    InterestIndex Principal
    Key Value
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HKT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFTrue
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo3zzSmartPyzzSTATiCzzzseJjWC%targetNat (200)

    Transaction [OK] by [KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3] at time [timestamp(0)] to KT1Tezooo3zzSmartPyzzSTATiCzzzseJjWC

    Balance: 0.000000tz

    Operations:

    Storage:

    Last
    ()

    getTotalSupply

    Multiple operations
    Transaction

    Transaction [OK] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    sp.contract(sp.TNat, KT1Tezooo3zzSmartPyzzSTATiCzzzseJjWC).open_some()

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TNat, KT1Tezooo3zzSmartPyzzSTATiCzzzseJjWC).open_some()

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TokenId TotalBorrows TotalReserves TotalSupply
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    Key AccountBorrows Approvals Balance
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    InterestIndex Principal
    Key Value
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HKT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFTrue
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo3zzSmartPyzzSTATiCzzzseJjWC%targetNat (200)

    Transaction [OK] by [KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3] at time [timestamp(0)] to KT1Tezooo3zzSmartPyzzSTATiCzzzseJjWC

    Balance: 0.000000tz

    Operations:

    Storage:

    Last
    ()

    Check setCash

    Try direct call

    Reverted transaction
    Transaction

    Transaction [KO] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance Request
    123
    Owner Token_id
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Error:

    Wrong condition:
    Message: 'OP_NOT_ACTIVE'
    ()

    Try with callback

    Reverted transaction
    Transaction

    Transaction [OK] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H

    Requests Callback
    Owner Token_id
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv30
    sp.contract(sp.TList(sp.TRecord(balance = sp.TNat, request = sp.TRecord(owner = sp.TAddress, token_id = sp.TNat).layout(("owner", "token_id"))).layout(("request", "balance"))), KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TList(sp.TRecord(balance = sp.TNat, request = sp.TRecord(owner = sp.TAddress, token_id = sp.TNat).layout(("owner", "token_id"))).layout(("request", "balance"))), KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()
    Balance Request
    200
    Owner Token_id
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Storage:

    Administrator All_tokens Ledger Metadata Operators Paused Token_metadata Total_supply
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    Key Balance
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    Key Value
    ''0x68747470733a2f2f6578616d706c652e636f6d
    Key Value
    Owner Operator Token_id
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1GwiKT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3
    False
    Key Token_id Token_info
    Key Value
    'decimals'0x32
    'name'0x54686520546f6b656e205a65726f
    'symbol'0x544b30
    Key Value
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%setCash (sp.list([sp.record(r...)

    Transaction [KO] by [KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance Request
    200
    Owner Token_id
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Error:

    Wrong condition:
    Message: 'OP_NOT_ACTIVE'
    ()

    Check transferOut

    Multiple operations
    Transaction

    Transaction [OK] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TRecord(callback = sp.TContract(sp.TList(sp.TRecord(balance = sp.TNat, request = sp.TRecord(owner = sp.TAddress, token_id = sp.TNat).layout(("owner", "token_id"))).layout(("request", "balance")))), requests = sp.TList(sp.TRecord(owner = sp.TAddress, token_id = sp.TNat).layout(("owner", "token_id")))).layout(("requests", "callback")), KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H).open_some()
    Requests Callback
    Owner Token_id
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv30
    sp.contract(sp.TList(sp.TRecord(balance = sp.TNat, request = sp.TRecord(owner = sp.TAddress, token_id = sp.TNat).layout(("owner", "token_id"))).layout(("request", "balance"))), KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()
    Transfer 0.000000tz to sp.contract(sp.TRecord(borrows = sp.TNat, cash = sp.TNat, cb = sp.TContract(sp.TNat), reserves = sp.TNat).layout((("borrows", "cash"), ("cb", "reserves"))), KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF).open_some()
    Borrows Cash Cb Reserves
    sp.contract(sp.TNat, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TokenId TotalBorrows TotalReserves TotalSupply
    8
    13
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    Key AccountBorrows Approvals Balance
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    InterestIndex Principal
    Key Value
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HKT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFTrue
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H%balance_of (sp.record(requests =...)

    Transaction [OK] by [KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3] at time [timestamp(0)] to KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H

    Requests Callback
    Owner Token_id
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv30
    sp.contract(sp.TList(sp.TRecord(balance = sp.TNat, request = sp.TRecord(owner = sp.TAddress, token_id = sp.TNat).layout(("owner", "token_id"))).layout(("request", "balance"))), KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TList(sp.TRecord(balance = sp.TNat, request = sp.TRecord(owner = sp.TAddress, token_id = sp.TNat).layout(("owner", "token_id"))).layout(("request", "balance"))), KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()
    Balance Request
    200
    Owner Token_id
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Storage:

    Administrator All_tokens Ledger Metadata Operators Paused Token_metadata Total_supply
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    Key Balance
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    Key Value
    ''0x68747470733a2f2f6578616d706c652e636f6d
    Key Value
    Owner Operator Token_id
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1GwiKT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3
    False
    Key Token_id Token_info
    Key Value
    'decimals'0x32
    'name'0x54686520546f6b656e205a65726f
    'symbol'0x544b30
    Key Value
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%setCash (sp.list([sp.record(r...) (Follow-up-transfer: KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H%balance_of (sp.record(requests =...))

    Transaction [OK] by [KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance Request
    200
    Owner Token_id
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TokenId TotalBorrows TotalReserves TotalSupply
    8
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    Key AccountBorrows Approvals Balance
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    InterestIndex Principal
    Key Value
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HKT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFTrue
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF%getBorrowRate (sp.record(borrows = ...)

    Transaction [OK] by [KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3] at time [timestamp(0)] to KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF

    Borrows Cash Cb Reserves
    sp.contract(sp.TNat, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TNat, KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3).open_some()

    Storage:

    BorrowRate SupplyRate
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3%doAccrueInterest (840000000000) (Follow-up-transfer: KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF%getBorrowRate (sp.record(borrows = ...))

    Transaction [OK] by [KT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eF] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TokenId TotalBorrows TotalReserves TotalSupply
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    Key AccountBorrows Approvals Balance
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    InterestIndex Principal
    Key Value
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HKT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFTrue
    ()
    Transaction

    Transaction [OK] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Storage:

    Borrow_allowed Mint_allowed Redeem_allowed Repay_borrow_allowed
    TrueTrueTrueTrue
    ()
    Transaction

    Transaction [OK] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi

    Balance: 0.000000tz

    Operations:

    Storage:

    Borrow_allowed Mint_allowed Redeem_allowed Repay_borrow_allowed
    TrueTrueTrueTrue
    ()
    Multiple operations
    Transaction

    Transaction [OK] by [tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TRecord(borrowAmount = sp.TNat, borrower = sp.TAddress, cToken = sp.TAddress).layout(("cToken", ("borrower", "borrowAmount"))), KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1).open_some()
    CToken Borrower BorrowAmount
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    Transfer 0.000000tz to sp.contract(sp.TList(sp.TRecord(from_ = sp.TAddress, txs = sp.TList(sp.TRecord(amount = sp.TNat, to_ = sp.TAddress, token_id = sp.TNat).layout(("to_", ("token_id", "amount"))))).layout(("from_", "txs"))), KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H).open_some()
    From_ Txs
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3
    Amount To_ Token_id
    10tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi0

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TokenId TotalBorrows TotalReserves TotalSupply
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    Key AccountBorrows Approvals Balance
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    InterestIndex Principal
    Key Value
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HKT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFFalse
    ()
    Transaction
    Follow-up-transfer: KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1%borrowAllowed (sp.record(cToken = s...)

    Transaction [OK] by [KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3] at time [timestamp(0)] to KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1

    CToken Borrower BorrowAmount
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi

    Balance: 0.000000tz

    Operations:

    Storage:

    Borrow_allowed Mint_allowed Redeem_allowed Repay_borrow_allowed
    TrueTrueTrueTrue
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H%transfer (sp.list([sp.record(f...)

    Transaction [OK] by [KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3] at time [timestamp(0)] to KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H

    From_ Txs
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3
    Amount To_ Token_id
    10tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi0

    Balance: 0.000000tz

    Operations:

    Storage:

    Administrator All_tokens Ledger Metadata Operators Paused Token_metadata Total_supply
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    Key Balance
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    Key Value
    ''0x68747470733a2f2f6578616d706c652e636f6d
    Key Value
    Owner Operator Token_id
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1GwiKT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3
    False
    Key Token_id Token_info
    Key Value
    'decimals'0x32
    'name'0x54686520546f6b656e205a65726f
    'symbol'0x544b30
    Key Value
    ()

    Check verifySweepFA12

    With underlying token and correct id

    Reverted transaction
    Transaction

    Transaction [KO] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Amount Id TokenAddress
    KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H

    Balance: 0.000000tz

    Error:

    Wrong condition:
    Message: 'CT_SWEEP_UNDERLYING'
    ()

    With underlying token and wrong id

    Transaction

    Transaction [OK] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H

    Address Amount Metadata Token_id
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3
    Key Value
    'decimals'0x32
    'name'0x54686520546f6b656e205a65726f
    'symbol'0x544b30

    Balance: 0.000000tz

    Operations:

    Storage:

    Administrator All_tokens Ledger Metadata Operators Paused Token_metadata Total_supply
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    Key Balance
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    Key Value
    ''0x68747470733a2f2f6578616d706c652e636f6d
    Key Value
    Owner Operator Token_id
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1GwiKT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3
    False
    Key Token_id Token_info
    Key Value
    'decimals'0x32
    'name'0x54686520546f6b656e205a65726f
    'symbol'0x544b30
    Key Value
    'decimals'0x32
    'name'0x54686520546f6b656e205a65726f
    'symbol'0x544b30
    Key Value
    ()
    Multiple operations
    Transaction

    Transaction [OK] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Amount Id TokenAddress
    KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TList(sp.TRecord(from_ = sp.TAddress, txs = sp.TList(sp.TRecord(amount = sp.TNat, to_ = sp.TAddress, token_id = sp.TNat).layout(("to_", ("token_id", "amount"))))).layout(("from_", "txs"))), KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H).open_some()
    From_ Txs
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3
    Amount To_ Token_id
    10tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP51

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TokenId TotalBorrows TotalReserves TotalSupply
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    Key AccountBorrows Approvals Balance
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    InterestIndex Principal
    Key Value
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HKT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFFalse
    ()
    Transaction
    Follow-up-transfer: KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H%transfer (sp.list([sp.record(f...)

    Transaction [OK] by [KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3] at time [timestamp(0)] to KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4H

    From_ Txs
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3
    Amount To_ Token_id
    10tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP51

    Balance: 0.000000tz

    Operations:

    Storage:

    Administrator All_tokens Ledger Metadata Operators Paused Token_metadata Total_supply
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    Key Balance
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    Key Value
    ''0x68747470733a2f2f6578616d706c652e636f6d
    Key Value
    Owner Operator Token_id
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1GwiKT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3
    False
    Key Token_id Token_info
    Key Value
    'decimals'0x32
    'name'0x54686520546f6b656e205a65726f
    'symbol'0x544b30
    Key Value
    'decimals'0x32
    'name'0x54686520546f6b656e205a65726f
    'symbol'0x544b30
    Key Value
    ()

    With random token

    Transaction

    Transaction [OK] by [tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5] at time [timestamp(0)] to KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3

    Amount Id TokenAddress
    KT10

    Balance: 0.000000tz

    Operations:

    Transfer 0.000000tz to sp.contract(sp.TList(sp.TRecord(from_ = sp.TAddress, txs = sp.TList(sp.TRecord(amount = sp.TNat, to_ = sp.TAddress, token_id = sp.TNat).layout(("to_", ("token_id", "amount"))))).layout(("from_", "txs"))), KT10).open_some()
    From_ Txs
    KT1Tezooo4zzSmartPyzzSTATiCzzzyPVdv3
    Amount To_ Token_id
    10tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP50

    Storage:

    AccrualBlockNumber AccrualIntPeriodRelevance ActiveOperations Administrator Balances BorrowIndex BorrowRateMaxMantissa BorrowRatePerBlock Comptroller CurrentCash ExpScale Fa2_TokenAddress HalfExpScale InitialExchangeRateMantissa InterestRateModel IsAccrualInterestValid PendingAdministrator ReserveFactorMantissa ReserveFactorMaxMantissa SupplyRatePerBlock TokenId TotalBorrows TotalReserves TotalSupply
    tz1UyQDepgtUBnWjyzzonqeDwaiWoQzRKSP5
    Key AccountBorrows Approvals Balance
    tz1WxrQuZ4CK1MBUa2GqUWK1yJ4J6EtG1Gwi
    InterestIndex Principal
    Key Value
    KT1TezoooozzSmartPyzzSTATiCzzzwwBFA1KT1Tezooo2zzSmartPyzzSTATiCzzzwqqQ4HKT1Tezooo1zzSmartPyzzSTATiCzzzyfC8eFFalse
    ()